const {resolve,json}=require('path');
let MinCssExtractPlugin=require('mini-css-extract-plugin');
module.exports={
    entry:"./src/mian.js",
    output:{
        filename:'js/[name].[hash:8].js',
        path:resolve(__dirname,'dist'), 
        clean:true
    },
    module:{
        rules:[
            {
                test:/\.css$/,
                use:[
                    MiniCssExtractplugin.loader,
                    'css-loader'
                ]
            },
            {
                test:/\.less$/,
                use:[
                    MiniCssExtractplugin.loader,
                    'css-loader',
                    'less-loader'
                ]
            },
           {
            test:/\.s[ac]ss/,
            use:[MinCsssExtractPlugin.loader,'css-loader','sass-loader'],
           },
        ]
    },
    plugins:[
        new MinCssExtractPlugin({
            filename:'css/[name].[hash:8].css'
        }),
    ] ,
    mode:'development'
}